<extend name="Layout:layout"/>

<block name="content">
    <!-- content start -->

    <div class="admin-content">
        <div class="admin-content-body">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">接收的数据</strong> /
                    <small>Table</small>
                </div>
            </div>

            <hr>

            <div class="am-g">

                <form action="" class="am-form" id="f" data-am-validator>
                    <div class="am-u-sm-1">
                        <input type="text" class="am-form-field" id="s_time" name="s_time" placeholder="日历组件"
                               data-am-datepicker readonly
                               required/>
                    </div>
                    <div class="am-u-sm-1">
                        <input type="text" class="am-form-field" id="e_time" name="e_time" placeholder="日历组件"
                               data-am-datepicker readonly
                               required/>
                    </div>
                    <div class="am-u-sm-1">
                        <button class="am-btn am-btn-primary" type="button" id="btn">提交</button>
                    </div>
                    <div class="am-u-sm-9">
                    </div>
                </form>

            </div>


            <div class="am-g">
                <div class="am-u-sm-12 am-scrollable-horizontol">

                        <table class="am-table am-table-striped am-table-hover table-main am-text-nowrap">
                            <thead>
                            <tr>
                             
                                <th class="table-id">ID</th>
                                <th class="table-title">content</th>
                                <th class="table-type">ip</th>
                                <th class="table-date am-hide-sm-only">创建日期</th>
                                <th class="table-set">操作</th>
                            </tr>
                            </thead>
                            <tbody>

                            <div  id="m">
                                <p style="text-align: center;margin:20px;">数据详情</p>
                                        <textarea id = "t" readonly="readonly" style="width:800px;min-height:500px; white-space: pre-line;">

                                        </textarea>
                            </div>

                            <volist name="datas" id="data">
                                <tr>

                                    <td>{{$data['id']}}</td>
                                    <td class="data-td">
                                        <a style="cursor:pointer" class="data">

                                            {{$data['title']}}

                                        </a>
                                        <div class="con" style = "display:none;">
                                            {{$data['content']}}
                                        </div>
                                    </td>




                                    <td>{{$data['ip']}}</td>
                                    <td class="am-hide-sm-only">{{$data['time']}}</td>
                                    <td>
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <form action="{{:U('admin/Syndata/del',['delete'=>$data['id']])}}"  id ='del_f'>
                                                    <button type = "submit"class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only">
                                                        <span class="am-icon-trash-o"></span> 删除

                                                    </button>
                                                </form>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </volist>

                            </tbody>
                        </table>


                        <div class="am-cf">

                            {{$page}}
                        </div>
                        <hr/>


                </div>

            </div>
        </div>


        <footer class="admin-content-footer">
            <hr>
            <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
        </footer>

    </div>
    <!-- content end -->

</block>
<block name="js">
    <script>
        $(function () {

            //進度條
            $.AMUI.progress.start();
            $.AMUI.progress.done();


            $('#btn').click(function () {
                var sTime = $('#s_time').val();
                var eTime = $('#e_time').val();
                if (eTime >= sTime) {
                    $('#f').submit();
                } else {
                    alert('结束时间不能早于开始时间')
                }
            })
            $('.data').click(function(){
                var content = $(this).siblings(".con").text();
                console.log(content);
                $('#t').val(content);
                setTimeout("document.getElementById('t').focus()",50);
                $('#m').show();
            });
            $('#t').blur(function(){
                $('#t').val("");
                $('#m').hide();
            });


        })
    </script>
    <script>

    </script>
</block>


